import { ISchema } from '@formily/react'
import { DataSourceSetter } from '@designable/formily-setters'

export const FixedDuration: ISchema = {
  type: 'object',
  properties: {
    nameCount: {
      type: 'string',
      'x-decorator': 'FormItem',
      'x-component': 'Input.TextArea',
      'x-component-props': {
        defaultValue: 'validCount',
      },
    },
    nameUnit: {
      type: 'string',
      'x-decorator': 'FormItem',
      'x-component': 'Input.TextArea',
      'x-component-props': {
        defaultValue: 'validUnit',
      },
    },
    addonTextBefore: {
      type: 'string',
      'x-decorator': 'FormItem',
      'x-component': 'Input',
    },
    required: {
      type: 'boolean',
      'x-decorator': 'FormItem',
      'x-component': 'Switch',
    },
    options: {
      type: 'array',
      'x-decorator': 'FormItem',
      'x-component': DataSourceSetter,
    },
  },
}
